3.151 \(\int \sin (e+f x) (a+b \sin (e+f x)) \, dx\)

Optimal. Leaf size=39 \[ -\frac{a \cos (e+f x)}{f}-\frac{b \sin (e+f x) \cos (e+f x)}{2 f}+\frac{b x}{2} \]

[Out]

(b*x)/2 - (a*Cos[e + f*x])/f - (b*Cos[e + f*x]*Sin[e + f*x])/(2*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0140097, antiderivative size = 39, normalized size of antiderivative = 1., number of steps used = 1, number of rules used = 1, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.059, Rules used = {2734} \[ -\frac{a \cos (e+f x)}{f}-\frac{b \sin (e+f x) \cos (e+f x)}{2 f}+\frac{b x}{2} \]

Antiderivative was successfully verified.

[In]

Int[Sin[e + f*x]*(a + b*Sin[e + f*x]),x]

[Out]

(b*x)/2 - (a*Cos[e + f*x])/f - (b*Cos[e + f*x]*Sin[e + f*x])/(2*f)

Rule 2734

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((2*a*c
+ b*d)*x)/2, x] + (-Simp[((b*c + a*d)*Cos[e + f*x])/f, x] - Simp[(b*d*Cos[e + f*x]*Sin[e + f*x])/(2*f), x]) /;
 FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]

Rubi steps

\begin{align*} \int \sin (e+f x) (a+b \sin (e+f x)) \, dx &=\frac{b x}{2}-\frac{a \cos (e+f x)}{f}-\frac{b \cos (e+f x) \sin (e+f x)}{2 f}\\ \end{align*}

Mathematica [A]  time = 0.0897402, size = 35, normalized size = 0.9 \[ -\frac{4 a \cos (e+f x)+b (\sin (2 (e+f x))-2 (e+f x))}{4 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Sin[e + f*x]*(a + b*Sin[e + f*x]),x]

[Out]

-(4*a*Cos[e + f*x] + b*(-2*(e + f*x) + Sin[2*(e + f*x)]))/(4*f)

________________________________________________________________________________________

Maple [A]  time = 0.013, size = 39, normalized size = 1. \begin{align*}{\frac{1}{f} \left ( b \left ( -{\frac{\sin \left ( fx+e \right ) \cos \left ( fx+e \right ) }{2}}+{\frac{fx}{2}}+{\frac{e}{2}} \right ) -\cos \left ( fx+e \right ) a \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(f*x+e)*(a+b*sin(f*x+e)),x)

[Out]

1/f*(b*(-1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)-cos(f*x+e)*a)

________________________________________________________________________________________

Maxima [A]  time = 1.73938, size = 49, normalized size = 1.26 \begin{align*} \frac{{\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} b - 4 \, a \cos \left (f x + e\right )}{4 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)*(a+b*sin(f*x+e)),x, algorithm="maxima")

[Out]

1/4*((2*f*x + 2*e - sin(2*f*x + 2*e))*b - 4*a*cos(f*x + e))/f

________________________________________________________________________________________

Fricas [A]  time = 1.60564, size = 86, normalized size = 2.21 \begin{align*} \frac{b f x - b \cos \left (f x + e\right ) \sin \left (f x + e\right ) - 2 \, a \cos \left (f x + e\right )}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)*(a+b*sin(f*x+e)),x, algorithm="fricas")

[Out]

1/2*(b*f*x - b*cos(f*x + e)*sin(f*x + e) - 2*a*cos(f*x + e))/f

________________________________________________________________________________________

Sympy [A]  time = 0.360071, size = 66, normalized size = 1.69 \begin{align*} \begin{cases} - \frac{a \cos{\left (e + f x \right )}}{f} + \frac{b x \sin ^{2}{\left (e + f x \right )}}{2} + \frac{b x \cos ^{2}{\left (e + f x \right )}}{2} - \frac{b \sin{\left (e + f x \right )} \cos{\left (e + f x \right )}}{2 f} & \text{for}\: f \neq 0 \\x \left (a + b \sin{\left (e \right )}\right ) \sin{\left (e \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)*(a+b*sin(f*x+e)),x)

[Out]

Piecewise((-a*cos(e + f*x)/f + b*x*sin(e + f*x)**2/2 + b*x*cos(e + f*x)**2/2 - b*sin(e + f*x)*cos(e + f*x)/(2*
f), Ne(f, 0)), (x*(a + b*sin(e))*sin(e), True))

________________________________________________________________________________________

Giac [A]  time = 1.68234, size = 46, normalized size = 1.18 \begin{align*} \frac{1}{2} \, b x - \frac{a \cos \left (f x + e\right )}{f} - \frac{b \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)*(a+b*sin(f*x+e)),x, algorithm="giac")

[Out]

1/2*b*x - a*cos(f*x + e)/f - 1/4*b*sin(2*f*x + 2*e)/f